package com.ctiot.custom.oauth.service;

import com.ctiot.custom.oauth.model.AccessToken;
import com.ctiot.custom.oauth.model.CheckToken;
import com.ctiot.custom.oauth.model.UserInfo;
import org.scribe.oauth.OAuthService;

/**
 * @projectName: oauth-sdk-bim
 * @packageName: com.ctiot.bim.oauth.service
 * @description:
 * @author: huayang.bai
 * @date: 2021-04-12 10:49
 */
public interface CustomOAuthService extends OAuthService {

    /**
     * 通过授权码获取访问token对象
     *
     * @param code
     * @return
     */
    AccessToken getAccessToken(String code);

    /**
     * 检查token
     *
     * @param accessToken
     * @return
     */
    CheckToken checkAccessToken(String accessToken);

    /**
     * 刷新token
     *
     * @param refreshToken
     * @return
     */
    AccessToken refreshAccessToken(String refreshToken);

    /**
     * 获取用户信息
     *
     * @param accessToken
     * @return
     */
    UserInfo getUserInfo(String accessToken);

}
